package com.huirui.server.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huirui.server.mapper.OrderSettingMapper;
import com.huirui.server.pojo.dto.OrderSettingDto;
import com.huirui.server.pojo.entity.OrderSetting;
import com.huirui.server.service.OrderSettingService;
import org.springframework.stereotype.Service;

/**
 * @author yujun
 * @description 针对表【t_order_setting(订单管理系统-订单设置表（存储订单相关的超时规则配置，用于系统自动处理订单状态）)】的数据库操作Service实现
 * @createDate 2025-11-30 09:06:37
 */
@Service
public class OrderSettingServiceImpl extends ServiceImpl<OrderSettingMapper, OrderSetting>
        implements OrderSettingService {

    @Override
    public OrderSetting getOrderSetting() {
        return lambdaQuery()
                .one();
    }

    @Override
    public void updateOrderSetting(OrderSettingDto orderSettingDto) {
        OrderSetting orderSetting = BeanUtil.copyProperties(orderSettingDto, OrderSetting.class);
        updateById(orderSetting);
    }
}




